import { Logger } from "./Logger";

const CryptoJS = require("crypto-js");

export class CryptoHelper{

    private static publicKey: string = '1kieoiwf90-*12zOp+-!afHV';


    public static encrypt(str: string) {
        Logger.log("CryptoTSHelper.encrypt=11=", CryptoJS)
        let encStr = CryptoJS.AES.encrypt(str, this.publicKey).toString()
        Logger.log("CryptoTSHelper.encrypt==", encStr)
        return encStr
    }

    public static decrypt(str: string) {
        var descStr:string = CryptoJS.AES.decrypt(str, this.publicKey).toString(CryptoJS.enc.Utf8);
        Logger.log("CryptoTSHelper.decrypt==2222", descStr)
        return descStr
    }
}